﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace wicFrac
{
    public partial class main : Form
    {
        public main()
        {
            InitializeComponent();
        }

        private void pictureBox1_DragLeave(object sender, EventArgs e)
        {
            //DoDragDrop(new FreeFormBox(new Rectangle(0, 0, 50, 50)), DragDropEffects.Link);
        }

        private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
        {
            pictureBox1.DoDragDrop(new FreeFormBox(new Rectangle(0, 0, 50, 50)), DragDropEffects.Move);
            txtStatus.Text = "picture dragged";
            
        }

        private void splitContainer1_Panel1_DragEnter(object sender, DragEventArgs e)
        {
            txtStatus.Text = "panel1 received data";
            //splitContainer1.Panel1.DoDragDrop(e.Data, e.AllowedEffect);
        }

        private void splitContainer1_Panel1_DragDrop(object sender, DragEventArgs e)
        {
            if (e.Data is FreeFormBox)
            {
                txtStatus.Text = "box placed";
                FreeFormBox ffb = e.Data as FreeFormBox;
                splitContainer1.Panel1.Controls.Add(ffb);
                ffb.Show();
            }
        }

        private void splitContainer1_Panel1_DoubleClick(object sender, EventArgs e)
        {
            
        }

        private void splitContainer1_Panel1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            txtStatus.Text = "box placed, " + e.Location.ToString();
            FreeFormBox ffb = new FreeFormBox(new Rectangle(e.Location,new Size(50,50)));
            splitContainer1.Panel1.Controls.Add(ffb);
            splitContainer1.Update();
        }
    }
}
